/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cronus.client;


import javax.swing.*;
import java.io.*;

/**
 *
 * @author Youri
 */
public class HelpScreen extends JFrame{
    private JTextArea usermanualtext;
    private File file;
    private StringBuffer buffer;
    private BufferedReader reader = null;
    private JPanel panel;
    
    
    public HelpScreen(String filepath){
        panel = new JPanel();
        usermanualtext = new JTextArea(27,56);
        usermanualtext.setBounds(0,0,640, 480);
        
        
        setContentPane(panel);
        
        panel.add(usermanualtext);
        usermanualtext.setEditable(false);
        
        file = new File(filepath);
        buffer = new StringBuffer();
        
        try {
            reader = new BufferedReader(new FileReader(file));
            String text = null;
            
            while((text = reader.readLine())!= null){
            buffer.append(text)
            .append(System.getProperty("line.separator"));
            }
            
        } catch (FileNotFoundException e) {
                e.printStackTrace();  
        } catch (IOException e) {
                e.printStackTrace();
            } finally {
                try {
                    if (reader != null) {
                    reader.close();
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
}
        usermanualtext.setText(buffer.toString());
 
    
        
        
        
       

        
    }
    
}
